#include<iostream>
using namespace std;
#include<cmath>

#include"library.h"

int main(){

	double a=0, b=M_PI, y, exact = M_E - 1;
	int n=10000;
	cout<<" Integration of sin(x) on [0, pi].\n";
	cout<<" midpoint: \t\t error="<< integ_midpoint(a,b,n,sin)-2<<endl;   // error should be ~ O(h^2)=O(10^{-8})
	cout<<" trapzoid: \t\t error="<< integ_trapzoid(a,b,n,sin)-2<<endl;   // ~O(h^2)=O(10^{-8})
	cout<<" Simpson:  \t\t error="<< Simpson(a,b,n,sin)-2<<endl;	// ~O(h^4)=O(10^{-16})
	return 0;
}
